﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
<head>
<title><s:text name="title.main.frame"/></title>
    
<link href="<s:url value='/common/lib/ligerUI/skins/Aqua/css/ligerui-all.css'/>" rel="stylesheet" type="text/css" />
<script src="<s:url value='/common/lib/jquery/jquery-1.3.2.min.js'/>" type="text/javascript"></script>
<script src="<s:url value='/common/lib/ligerUI/js/core/base.js'/>" type="text/javascript"></script>
<script src="<s:url value='/common/lib/ligerUI/js/plugins/ligerTree.js'/>" type="text/javascript"></script>
<script src="<s:url value='/common/lib/ligerUI/js/plugins/ligerLayout.js'/>" type="text/javascript"></script>
<script src="<s:url value='/common/lib/ligerUI/js/plugins/ligerTab.js'/>" type="text/javascript"></script>
<script src="<s:url value='/common/lib/ligerUI/js/plugins/ligerAccordion.js'/>" type="text/javascript"></script>
<script type="text/javascript">
	var tab = null;
	var accordion = null;
	var tree = null;
	
	$(function(){
        $("#layout1").ligerLayout({leftWidth:190, height:'100%', heightDiff:-34, space:4, onHeightChanged:f_heightChanged});
        
        var height = $(".l-layout-center").height();
        $("#framecenter").ligerTab({height: height});
        $("#accordion1").ligerAccordion({height:height - 24, speed: null});

        $(".l-link").hover(function () {
            	$(this).addClass("l-link-over");
        	}, 
        	function () {
            	$(this).removeClass("l-link-over");
        	}
        );
        
        var indexdata_0 = [
				{text:'库存管理', isexpand:false, children:[
					<s:if test="#session.role.name=='admin'">
					{url:"<s:url value='/record/toUploadOriginalData.action'/>", text:"上传OMD系统清单"},
					{url:"<s:url value='/record/toUploadVINImages.action'/>", text:"上传VIN\/OMD照片"},
					{url:"<s:url value='/record/toStatistics.action'/>", text:"生成/完善信息整理表"},
					{url:"<s:url value='/record/toViewOutOfSystemRecord.action'/>", text:"查看系统外文件"},
					{url:"<s:url value='/record/toUploadProvedData.action'/>", text:"上传证明文件"},
					{url:"<s:url value='/record/toDelete.action'/>", text:"删除数据"},
					{url:"<s:url value='/record/toDownload.action'/>", text:"下载明细目录"},
					{url:"<s:url value='/record/toDataSynch.action'/>", text:"数据同步"}
					<s:if test="#session.user.account=='root'">
					,{url:"<s:url value='/record/toQStatistic.action'/>", text:"生成季度统计表"},
					{url:"<s:url value='/record/toVINStatistic.action'/>", text:"生成整车库存盘查明细表"}
					</s:if>
					</s:if>
					<s:if test="#session.role.name=='operator'">
					{url:"<s:url value='/record/toUploadOriginalData.action'/>", text:"上传OMD系统清单"},
					{url:"<s:url value='/record/toUploadVINImages.action'/>", text:"上传VIN\/OMD照片"},
					{url:"<s:url value='/record/toOperatorStatistics.action'/>", text:"生成/完善信息整理表"},
					{url:"<s:url value='/record/toViewOutOfSystemRecord.action'/>", text:"查看系统外文件"},
					{url:"<s:url value='/record/toUploadProvedData.action'/>", text:"上传证明文件"},
					{url:"<s:url value='/record/toWorkFinish.action'/>", text:"完成盘查"},
					{url:"<s:url value='/record/toOperatorDelete.action'/>", text:"删除数据"},
					{url:"<s:url value='/record/toOperatorDownload.action'/>", text:"下载明细目录"},
					{url:"<s:url value='/record/toDataSynch.action'/>", text:"数据同步"}
					</s:if>
					<s:if test="#session.role.name=='monitor'">
					{url:"<s:url value='/record/toStatistics.action'/>", text:"查看明细表"},
					{url:"<s:url value='/record/toDownload.action'/>", text:"下载明细目录"}
					</s:if>
		]}];
        
        $("#tree0").ligerTree({
            data:indexdata_0,
            checkbox:false,
            slide:false,
            nodeWidth:120,
            attribute:['nodename', 'url'],
            onSelect:function (node) {
                if (!node.data.url) return;
                var tabid = $(node.target).attr("tabid");
                if (!tabid) {
                    tabid = new Date().getTime();
                    $(node.target).attr("tabid", tabid)
                } 
                f_addTab(tabid, node.data.text, node.data.url);
            }
        });
        
        <s:if test="#session.role.name=='admin'">
        var indexdata_1 = [
			{ text: '<s:text name="title.main.frame.user.management"/>', isexpand:false, children: [ 
				{url:"<s:url value='/user/toUserList.action'/>",text:"<s:text name='title.main.frame.user.management.list'/>"},
				{url:"<s:url value='/user/toAddUser.action'/>",text:"<s:text name='title.main.frame.user.management.add'/>"},
				{url:"<s:url value='/record/toWorkloadStatistic.action'/>", text:"执行员工作量统计"}
         ]}];
        
        $("#tree1").ligerTree({
            data:indexdata_1,
            checkbox:false,
            slide:false,
            nodeWidth:120,
            attribute:['nodename', 'url'],
            onSelect:function (node) {
                if (!node.data.url) return;
                var tabid = $(node.target).attr("tabid");
                if (!tabid) {
                    tabid = new Date().getTime();
                    $(node.target).attr("tabid", tabid)
                } 
                f_addTab(tabid, node.data.text, node.data.url);
            }
        });
        </s:if>
       

        tab = $("#framecenter").ligerGetTabManager();
        accordion = $("#accordion1").ligerGetAccordionManager();
        //tree = $("#tree1").ligerGetTreeManager();
        $("#pageloading").hide();
	});
	
	function f_heightChanged(options) {
        if (tab) tab.addHeight(options.diff);
        if (accordion && options.middleHeight - 24 > 0) accordion.setHeight(options.middleHeight - 24);
    }
	
    function f_addTab(tabid, text, url) { 
        tab.addTabItem({tabid : tabid, text: text, url: url});
    }
</script>

    
<style type="text/css">
	body,html{height:100%;}
    body{padding:0px; margin:0; overflow:hidden;}  
    .l-link{display:block; height:26px; line-height:26px; padding-left:10px; text-decoration:underline; color:#333;}
    .l-link2{text-decoration:underline; color:white; margin-left:2px; margin-right:2px;}
    .l-layout-top{background:#102A49; color:White;}
    .l-layout-bottom{ background:#E5EDEF; text-align:center;}
    #pageloading{position:absolute; left:0px; top:0px; background:white url('<s:url value="/common/lib/images/loading.gif"/>') no-repeat center; width:100%; height:100%; z-index:99999;}
    .l-link{display:block; line-height:22px; height:22px; padding-left:16px;border:1px solid white; margin:4px;}
    .l-link-over{background:#FFEEAC; border:1px solid #DB9F00;} 
    .l-winbar{background:#2B5A76; height:30px; position:absolute; left:0px; bottom:0px; width:100%; z-index:99999;}
    .space{color:#E7E7E7;}
    .l-topmenu{margin:0; padding:0; height:31px; line-height:31px; background:url('<s:url value="/common/lib/images/top.jpg"/>') repeat-x bottom;  position:relative; border-top:1px solid #1D438B;}
    .l-topmenu-logo{color:#E7E7E7; padding-left:35px; line-height:26px;}
    .l-topmenu-welcome{position:absolute; height:24px; line-height:24px;  right:30px; top:2px;color:#070A0C;}
    .l-topmenu-welcome a{color:#E7E7E7; text-decoration:underline}
</style>
</head>
<body style="padding:0px;background:#EAEEF5;">
	<div id="pageloading"></div>
	
	<div id="topmenu" class="l-topmenu">
    	<div class="l-topmenu-logo">经销商库存盘查在线系统</div>
	    <div class="l-topmenu-welcome">
	        <a href="javascript:f_addTab('updatePassword','修改密码', '/aim/user/toUpdatePassword.action')" style="color: #ffffff;"><s:text name='title.main.frame.update.password'/></a>
	        <span class="space">|</span>
			<a href="<s:url value='logout.action'/>" style="color: #ffffff;"><s:text name='title.main.frame.exit'/></a>
	    </div> 
	</div>
	
	<div id="layout1" style="width:99.2%; margin:0 auto; margin-top:4px;">
		<div position="left" title="菜单" id="accordion1"> 
               <div title="<s:text name='title.main.frame.inventory.management'/>" class="l-scroll">
                    <ul id="tree0" style="margin-top:3px;"/> 
			   </div>
			   
			   <s:if test="#session.role.name=='admin'">
               <div title="<s:text name='title.main.frame.user.management'/>" class="l-scroll">
               		<ul id="tree1" style="margin-top:3px;"/>
               </div>
               </s:if>
        </div>
		<div position="center" id="framecenter"> 
            <div tabid="home" title="欢迎" style="height:300px" >
                <iframe frameborder="0" name="home" id="home" src="<s:url value='welcome.jsp'/>"></iframe>
            </div> 
        </div>
	</div>
	
	<div style="height:32px; line-height:32px; text-align:center;">Copyright © 2013 auto inventory management system</div>
	
	<div style="display:none;"></div>
</body>
</html>
